import router from "./router";

export function setSessionStorage(key,value){
    sessionStorage.setItem(key, JSON.stringify(value));
}
export function getSessionStorage(key){
    const str=sessionStorage.getItem(key);
    if(str==null||str=="null"||str==""||str==undefined){
        return null;
    }
    return JSON.parse(str);
}
export function delSessionStorage(key){
    sessionStorage.removeItem(key);
}

export function noLogin(){
    alert("请先登录！");
    router.push("/");
}